<?php
require_once("Elements.php");
		
class RegisterForm extends  Zend_Form
{
	private $user;
	
	/**
	 * Constructor.
	 * 
	 * @param $user user
	 */
	public function RegisterForm($user) {
		$this->user = $user;
		$this->__construct();	
	}
	
	public function init() 
	{	
		$this->setName('registerForm');	
		$this->setMethod('post');
		$this->setAction('register');
		$languageFile = Zend_Registry::get('languageFile');
        $translate = new Zend_Translate('array',$languageFile, 'zh_CN');
        $this->setTranslator($translate);
		
		$elements = new Elements();
		
		$this->addElement($elements->getEmailTextField($this->user));
		$this->addElement($elements->getUsernameTextField());
		$this->addElement($elements->getPasswordTextField());
		$this->addElement($elements->getConfirmTextField());
		$this->addElement($elements->getHiddenField($this->user));
		
		$register = $this->createElement('submit','register');
		$register->setIgnore(true);
	//	$register->removeDecorator('DtDdWrapper');
		
		$this->addElement($register);
	}
	
/*	public function loadDefaultDecorators() {
     $this->setDecorators(
         array(
             array('ViewScript', 
                 array('viewScript' => 'customize/RegisterForm.phtml')
             )
          )
      );
}*/
}
